package com.aiden.cashbook.data.charge

import com.aiden.cashbook.bean.Bill
import com.aiden.cashbook.bean.UseType

class ChargeRepository (private var chargeLocalDataSource: ChargeDataSource, private var chargeRemoteDataSource: ChargeDataSource) : ChargeDataSource {
    // TODO 使用RxJava的concat操作符执行本地和网络请求

    override fun chargeAccount(bill: Bill, callback: ChargeDataSource.SavedCallback) {
        chargeLocalDataSource.chargeAccount(bill, callback)
//        chargeRemoteDataSource.chargeAccount(bill, callback)
    }

    override fun accountType(type: String, callback: ChargeDataSource.LoadListCallBack<UseType>) {
        chargeLocalDataSource.accountType(type, callback)
    }

    override fun billList(userId: Long, page: Int, size: Int, callback: ChargeDataSource.LoadListCallBack<Bill>) {
        chargeLocalDataSource.billList(userId, page, size, callback)
    }
}